package common.message.clientSend;

import java.util.Date;

import common.message.Message;

public class ChatWithFriendMsg extends Message {
	
	private static final long serialVersionUID = 2305280180039750990L;
	
	private String message;
	private Date time = null;
	private boolean timeSet = false;
	
	public ChatWithFriendMsg(int uid, int fuid, String msg) {
		super(getUserFlag() + Integer.toString(uid), getUserFlag() + Integer.toString(fuid));
		message = msg;
	}
	
	public ChatWithFriendMsg(Integer uid, Integer fuid, String msg) {
		super(getUserFlag() + uid.toString(), getUserFlag() + fuid.toString());
		message = msg;
	}
	
	public int getUserID() { return getFromUserID(); }
	public Date getTime() { return time; }
	public void setTime() {
		if (!timeSet) {
			// use it only once
			time = new Date();
			timeSet = true;
		}
	}
//	public int getFriendUserID() { return getToUserID(); }
	public String getMessage() { return message; }
	
}
